package 归并;

public class 归并排序 {
    public static void bubble_sort(int a[]){
        int i,j;
        int temp;
        for(j=0;j<a.length-1;j++){
            for (i=0;i<a.length-1-j;i++){
                if (a[i]>a[i+1]){
                    temp=a[i];
                    a[i]=a[i+1];
                    a[i+1]=temp;
                }
            }
        }
    }

    public static void main(String[] args) {
        int a[]=new int[]{12,13,11,10,3,6,5,2,9};
        bubble_sort(a);
        for (int i=0;i<a.length;i++){
            System.out.print(a[i]+",");
        }
    }

}
